<%@ page contentType="text/html;charset=GB2312"%><%@ page import="java.sql.*"%><%@ page import="javax.sql.*"%><%@ page import="javax.naming.*"%>

<html>
  <head>
  </head>
  
  <body>
 <%
  
   
  try {


    Context initCtx = new InitialContext();
   
    Context envCtx = (Context) initCtx.lookup("java:comp/env");

    DataSource ds = (DataSource) envCtx.lookup("jdbc/mail");  

    
    Connection conn = ds.getConnection();
  out.println("3---------");
    Statement stmt = conn.createStatement();
   // out.println("sql="+new Statistic().getMailsql(begintime,endtime,12));
    ResultSet rs = stmt.executeQuery("select top 10 * from users ");
    out.println("4---------");
    while(rs.next()) {
    out.println(rs.getString("username"));
     }
     out.println("5---------");
    rs.close();
    stmt.close();
    conn.close();
    
   } catch (Exception e) {

 out.println("6--------");
   }
  
 %>
  </body>
</html>
